<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/includes/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>推送平台</title>
	<meta name="menu" content="notification" />
	<link rel="stylesheet" type="text/css" href="plug-in/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="plug-in/easyui/themes/icon.css">
	<script type="text/javascript" src="plug-in/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.js"></script>    
</head>
<!-- onclick="show_selected_item_val(this)" -->
<body>
<div style="margin:20px 0px;">
<form action="notification.do?action=send" method="post" style="margin: 0px;">
<div class="left_pad">
	<h1 class="title_pad">请选择推送目标：</h1>
	<label><input type="radio" name="broadcast" value="Y" checked="checked" /><span>所有人</span> </label>
	<c:forEach var="group" items="${group}">
		<label><input name="broadcast" type="radio" value="${group}"/><span>${group}</span></label>
	</c:forEach>
    <input type="radio" name="broadcast" value="N" style="display:none;"/> 
    <c:forEach var="users" items="${users}">
			<label><input name="username" type="radio" value="${users.username}"/><span>${users.name}</span></label><br />
	</c:forEach>
</div>
<div class="center_pad">
	<h1 class="title_pad">消息推送</h1>
	<table width="600" cellpadding="4" cellspacing="0" border="0">
<tr style="display:none;">
	<td>消息标题:</td>
	<td><input type="text" id="title" name="title" value="新消息" style="width:380px;" /></td>
</tr>
<tr>
	<td style="font-size:1.5vw;">请输入消息内容:</td>
	<td><textarea id="message" name="message" style="width:380px; height:80px;border:1px solid #d9d9d9"></textarea></td>
</tr>
<tr style="display:none;">
	<td>URI:</td>
	<td><input type="text" id="uri" name="uri" value="123" style="width:380px;" />
	    <br/><span style="font-size:0.8em">ex) http://www.dokdocorea.com, geo:37.24,131.86, tel:111-222-3333</span>
	</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" value="推送" style="width:80px;height:40px;"/></td>
</tr>
</table> 
</div>
<div class="right_pad">
	<h1 class="title_pad">请选择要推送的消息：</h1>
	<c:forEach var="message" items="${message}">
		<label><input id="${message.id}" name="message1" class="radioInput" type="checkbox" onclick="show_selected_item_val(this)" value="${message.message}" /><span class="radioMsg">${message.message}</span></label><br /> 
	</c:forEach>
</div>
</form>
</div>

<script type="text/javascript"> 
function show_selected_item_val($item){  
	if($item.checked){
		//alert($item.value);
		document.getElementById("message").value= $item.value;  
	}else{
		document.getElementById("message").value= ""; 
	}	
}
$(function(){
	
});
</script>
</body>
</html>